home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / obero / oberon_lib.lha / oberon-a / source1.lha / source / Amiga / Gadgets.mod < prev    next >
Text File  |  1994-08-08  |  6KB  |  208 lines

  1. (*************************************************************************
  2.  
  3.      $RCSfile: Gadgets.mod $
  4.   Description: Interface to the colorwheel, tapedeck and gradientslider
  5.                gadgets.
  6.  
  7.    Created by: fjc (Frank Copeland)
  8.     $Revision: 3.1 $
  9.       $Author: fjc $
  10.         $Date: 1994/08/08 01:16:55 $
  11.  
  12.   Includes Release 40.15
  13.  
  14.   (C) Copyright 1992-1993 Commodore-Amiga Inc.
  15.       All Rights Reserved
  16.  
  17.   Oberon-A Interface Copyright © 1994, Frank Copeland.
  18.   This file is part of the Oberon-A Interface.
  19.   See Oberon-A.doc for conditions of use and distribution.
  20.  
  21. *************************************************************************)
  22.  
  23. MODULE Gadgets;
  24.  
  25. (*
  26. ** $C- CaseChk       $I- IndexChk  $L+ LongAdr   $N- NilChk
  27. ** $P- PortableCode  $R- RangeChk  $S- StackChk  $T- TypeChk
  28. ** $V- OvflChk       $Z- ZeroVars
  29. *)
  30.  
  31. IMPORT
  32.   E   := Exec,
  33.   U   := Utility,
  34.   SYS := SYSTEM;
  35.  
  36. (*
  37. **      $VER: gradientslider.h 39.1 (18.6.92)
  38. **
  39. **      Definitions for the gradientslider BOOPSI class
  40. *)
  41.  
  42. (************************************************************************)
  43.  
  44. CONST
  45.  
  46.   gradDummy *      = U.tagUser + 005000000H;
  47.   gradMaxVal *     = gradDummy+1;  (* max value of slider         *)
  48.   gradCurVal *     = gradDummy+2;  (* current value of slider     *)
  49.   gradSkipVal *    = gradDummy+3;  (* "body click" move amount    *)
  50.   gradKnobPixels * = gradDummy+4;  (* size of knob in pixels      *)
  51.   gradPenArray *   = gradDummy+5;  (* pen colors                  *)
  52.  
  53.  
  54. (************************************************************************)
  55.  
  56. (*
  57. **      $VER: tapedeck.h 40.0 (12.3.93)
  58. **
  59. **      Definitions for the tapedeck BOOPSI class
  60. *)
  61.  
  62. (************************************************************************)
  63.  
  64. CONST
  65.  
  66.   tdeckDummy *     = U.tagUser + 005000000H;
  67.   tdeckMode *      = tdeckDummy + 1;
  68.   tdeckPaused *    = tdeckDummy + 2;
  69.  
  70.   tdeckTape *      = tdeckDummy + 3;
  71.     (* (BOOL) Indicate whether tapedeck or animation controls.  Defaults
  72.      * to FALSE. *)
  73.  
  74.   tdeckFrames *    = tdeckDummy + 11;
  75.     (* (LONG) Number of frames in animation.  Only valid when using
  76.      * animation controls. *)
  77.  
  78.   tdeckCurrentframe * = tdeckDummy + 12;
  79.     (* (LONG) Current frame.  Only valid when using animation controls. *)
  80.  
  81. (************************************************************************)
  82.  
  83. CONST
  84.  
  85. (* Possible values for tdeckMode *)
  86.   butRewind *  = 0;
  87.   butPlay *    = 1;
  88.   butForward * = 2;
  89.   butStop *    = 3;
  90.   butPause *   = 4;
  91.   butBegin *   = 5;
  92.   butFrame *   = 6;
  93.   butEnd *     = 7;
  94.  
  95. (***********************************************************************)
  96.  
  97. (*
  98. **      $VER: colorwheel.h 39.2 (22.6.92)
  99. **
  100. **      Definitions for the colorwheel BOOPSI class
  101. *)
  102.  
  103. (***********************************************************************)
  104.  
  105. TYPE
  106.  
  107. (* For use with the WHEEL_HSB tag *)
  108.   ColorWheelHSBPtr * = CPOINTER TO ColorWheelHSB;
  109.   ColorWheelHSB * = RECORD
  110.     hue * : E.ULONG;
  111.     saturation * : E.ULONG;
  112.     brightness * : E.ULONG;
  113.   END;
  114.  
  115. (* For use with the WHEEL_RGB tag *)
  116.   ColorWheelRGBPtr * = CPOINTER TO ColorWheelRGB;
  117.   ColorWheelRGB * = RECORD
  118.     red * : E.ULONG;
  119.     green * : E.ULONG;
  120.     blue * : E.ULONG;
  121.   END;
  122.  
  123.  
  124. (***********************************************************************)
  125.  
  126. CONST
  127.  
  128.   wheelDummy *          = U.tagUser + 004000000H;
  129.   wheelHue *            = wheelDummy+1;  (* set/get Hue               *)
  130.   wheelSaturation *     = wheelDummy+2;  (* set/get Saturation        *)
  131.   wheelBrightness *     = wheelDummy+3;  (* set/get Brightness        *)
  132.   wheelHSB *            = wheelDummy+4;  (* set/get ColorWheelHSB     *)
  133.   wheelRed *            = wheelDummy+5;  (* set/get Red               *)
  134.   wheelGreen *          = wheelDummy+6;  (* set/get Green             *)
  135.   wheelBlue *           = wheelDummy+7;  (* set/get Blue              *)
  136.   wheelRGB *            = wheelDummy+8;  (* set/get ColorWheelRGB     *)
  137.   wheelScreen *         = wheelDummy+9;  (* init screen/enviroment    *)
  138.   wheelAbbrv *          = wheelDummy+10; (* "GCBMRY" if English       *)
  139.   wheelDonation *       = wheelDummy+11; (* colors donated by app     *)
  140.   wheelBevelBox *       = wheelDummy+12; (* inside a bevel box        *)
  141.   wheelGradientSlider * = wheelDummy+13; (* attached gradient slider  *)
  142.   wheelMaxPens *        = wheelDummy+14; (* max # of pens to allocate *)
  143.  
  144.  
  145. (*-- Library Base variable --------------------------------------------*)
  146.  
  147. CONST
  148.  
  149.   colorwheelName * = "colorwheel.library";
  150.  
  151. TYPE
  152.  
  153.   ColorWheelBasePtr* = CPOINTER TO ColorWheelBase;
  154.   ColorWheelBase* = RECORD (E.Library) END;
  155.  
  156. VAR
  157.  
  158.   base* : ColorWheelBasePtr;
  159.  
  160.  
  161. (*-- Library Functions ------------------------------------------------*)
  162.  
  163. (*
  164. **      $VER: colorwheel_protos.h 39.1 (21.7.92)
  165. *)
  166.  
  167. (*--- functions in V39 or higher (Release 3) ---*)
  168.  
  169. (* Public entries *)
  170.  
  171. LIBCALL (base : ColorWheelBasePtr) ConvertHSBToRGB *
  172.   ( hsb [8] : ColorWheelHSBPtr;
  173.     rgb [9] : ColorWheelRGBPtr );
  174.   -30;
  175.  
  176. LIBCALL (base : ColorWheelBasePtr) ConvertRGBToHSB *
  177.   ( rgb [8] : ColorWheelRGBPtr;
  178.     hsb [9] : ColorWheelHSBPtr );
  179.   -36;
  180.  
  181. (*-- Library Base variable --------------------------------------------*)
  182.  
  183. (*-----------------------------------*)
  184. PROCEDURE* CloseColorWheel ();
  185.  
  186. BEGIN (* CloseColorWheel *)
  187.   IF base # NIL THEN E.base.CloseLibrary (base) END
  188. END CloseColorWheel;
  189.  
  190. (*-----------------------------------*)
  191. PROCEDURE OpenColorWheel * (mustOpen : BOOLEAN);
  192.  
  193. BEGIN (* OpenColorWheel *)
  194.   IF base = NIL THEN
  195.     base :=
  196.       SYS.VAL (
  197.         ColorWheelBasePtr,
  198.         E.base.OpenLibrary (colorwheelName, E.libraryMinimum));
  199.     IF base # NIL THEN SYS.SETCLEANUP (CloseColorWheel)
  200.     ELSIF mustOpen THEN HALT (100)
  201.     END;
  202.   END;
  203. END OpenColorWheel;
  204.  
  205. BEGIN
  206.   base := NIL
  207. END Gadgets.
  208.